#include "boom.h"
#include<QDebug>
Boom::Boom()
{
    for(int i=1;i<=BOOM_INDEX;i++)
        {
            QString str=QString(BOOM_PATH).arg(i);
                m_pixArr.push_back(QPixmap(str));
        }
        m_X=0;
        m_Y=0;
        m_Free=true;
        m_index=0;
        m_Recorder=0;
}

void Boom::updateInfo()
{

    if(m_Free)
    {
        return;
    }
    m_Recorder++;

    if(m_Recorder<BOOM_INTERVAL)
    {
        return;
    }

    m_Recorder=0;
    m_index++;

    if(m_index>=BOOM_INDEX)
    {
        m_index=0;
        m_Free=true;

    }
}
